<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"     
      xmlns:p="http://primefaces.org/ui"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
    <h:head>
        <title>Facelet Title</title>
        <link rel="stylesheet" href="/Ensayos/Diseños/Login.css"/>
    </h:head>
    <h:body>
        <section class="login">
        <h:form >
            <h:panelGrid id="grid" columns="1">
                <p><p:inputText id="email" placeholder="alguien@example.com" value="#{mBLogin.email}"/></p>
                <p><p:password id="clave" placeholder="Contraseña" value="#{mBLogin.clave}"/></p>
                <section class="seccionBotones">  
                <h:commandButton value="Ingresar" action="#{mBLogin.login}"/><!--boton con tag h: `para poder abrir una ventana face-->
                <p:commandButton update="grid" value="Registrarse" onclick="PF('dlg2').show();"/>
                </section>                
            </h:panelGrid>            
        </h:form>
        <h:form id="registrodeacceso">         
        <p:dialog header="Registro De Acceso" widgetVar="dlg2" modal="true" height="160">           
           <h:panelGrid id="grid" columns="1" cellpadding="2">              
               <p:inputText id="email" pt:placeholder="Email"  required="true" label="Email" value="#{mBRLogin.login.email}"/>                     
               <p:password id="pwd1"  pt:placeholder="Contraseña" feedback="true" inline="true" match="pwd2" label="Contraseña 1" required="true" value="#{mBRLogin.login.clave}" />
                <p:password id="pwd2" pt:placeholder="Repita contraseña" feedback="true" inline="true" label="Contraseña 2" required="true" />
           </h:panelGrid>
            <p:commandButton update="grid" value="Registrar" action="#{mBRLogin.register()}" />    
        </p:dialog>  
        </h:form>
        </section>
    </h:body>
</html>

